package com.zhike.b2b.buy;

import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zhike.b2b.base.BaseAction;
import com.zhike.b2b.model.ClassVo;

@Controller
public class BuyAction extends BaseAction{
	
	@RequestMapping("/buy/typelist.do")
	public @ResponseBody String getProdClasss(@RequestParam("class_id") String classId,Model model)
	{
		    List<ClassVo> lcv = is.queryBuyClzs(classId, "", false);
		    StringBuffer buff = new StringBuffer();
		    if (lcv != null && lcv.size()>0)
		    {
		       buff.append("<option value='selected'>--请选择--</option>");
		      for (ClassVo cv : lcv)
		      {
		         buff.append("<option value='").append(cv.getClassId()).append("'>")
		             .append(cv.getClassName()).append("</option>");
		      }
		    }else
		    	buff.append("");
	   return buff.toString();
	}
}
